import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../layout/Layout.vue'

import Personal from "@/views/Personal.vue";
import Student from "@/views/Student.vue";
import Register from "@/views/Register.vue";
import Login from "@/views/Login.vue";
import User from "@/views/User.vue";
import Rule from "@/views/Rule.vue";
import Petr from "@/views/Petr.vue";
import Medical from "@/views/Drug.vue";
import Diagnosis from "@/views/Diagnosis.vue";
import Drug from "@/views/Drug.vue";
import Facility from "@/views/Facility.vue";
import Dcon from "@/views/Dcon.vue";


const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect:"/user",
    children:[
      {
        path:'/user',
        name:'User',
        component: User
      },
      {
        path: '/rule',
        name: 'Rule',
        component: Rule
      },
      {
        path:'/petr',
        name:'Petr',
        component: Petr
      },
      {
        path: '/personal',
        name: 'Personal',
        component: Personal
      },

      {
        path: '/student',
        name: 'Student',
        component: Student
      },
      {
        path: '/diagnosis',
        name: 'Diagnosis',
        component: Diagnosis
      },
      {
        path: '/medical',
        name: 'Medical',
        component: Medical
      },
      {
        path: '/drug',
        name: 'Drug',
        component: Drug
      },
      {
        path: '/facility',
        name: 'Facility',
        component: Facility
      },
      {
        path: '/dcon',
        name: 'Dcon',
        component: Dcon
      },

    ]
  },

  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  },



]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
